A render queue, where all items that have to be rendered are queued. More...
Public Member Functions | |
virtual Buffer * | getAccelerationStructureBuffer () const |
nkMemory::StringView | getName () const |
bool | getRaytraced () const |
bool | getHidden () const |
Entity * | getEntity (unsigned int index) const |
unsigned int | getEntityCount () const |
RenderStrategy * | getRenderStrategy () const |
virtual void | setName (const nkMemory::StringView &name) |
virtual void | setRaytraced (bool value) |
void | setRenderStrategy (RenderStrategy *value) |
void | setHidden (bool value) |
virtual Entity * | addEntity () |
virtual void | eraseEntity (Entity *ent) |
virtual void | clearQueue () |
RenderCommandQueue | bakeRenderCommandQueue (Shader *shader=nullptr, bool transparent=false) |
virtual void | updateEntityNode (Entity *ent, Node *oldNode) |
virtual void | updateEntityRenderInfo (Entity *ent, EntityRenderInfo *oldInfo, EntityRenderInfo *newInfo) |
virtual void | updateMesh (Entity *ent, EntityRenderInfoSlot *slot, EntityRenderLodSlot *lod, Mesh *oldMesh, Mesh *newMesh) |
virtual void | updateShader (Entity *ent, EntityRenderInfoSlot *slot, EntityRenderLodSlot *lod, Shader *oldShader, Shader *newShader) |
virtual void | updateShaderRaytracing (Entity *ent, EntityRenderInfoSlot *slot, EntityRenderLodSlot *lod, Shader *oldShader, Shader *newShader) |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
![]() | |
Exportable () | |
virtual | ~Exportable () |
A render queue, where all items that have to be rendered are queued.
A queue can allocate entities to render. The entities can be used as-is, or attached to a Node, using Entity::setParentNode(). When an object is attached to the graph, it enables it to work with the transformations from the nodes.
|
virtual |
Retrieves the acceleration structure's buffer. This buffer can be fed to shaders for raytracing. If raytracing is not supported, this buffer will be empty.
nkMemory::StringView nkGraphics::RenderQueue::getName | ( | ) | const |
bool nkGraphics::RenderQueue::getRaytraced | ( | ) | const |
bool nkGraphics::RenderQueue::getHidden | ( | ) | const |
Entity* nkGraphics::RenderQueue::getEntity | ( | unsigned int | index | ) | const |
index | The index of the entity to retrieve. |
unsigned int nkGraphics::RenderQueue::getEntityCount | ( | ) | const |
RenderStrategy* nkGraphics::RenderQueue::getRenderStrategy | ( | ) | const |
|
virtual |
name | The name to set. |
|
virtual |
Sets whether this queue should be raytraced. Raytraced queues will keep their acceleration structures updated as they change. Enable this only when needed.
value | If the queue should be raytraced (true) or not (false). |
void nkGraphics::RenderQueue::setRenderStrategy | ( | RenderStrategy * | value | ) |
Sets the strategy to use when rendering a pass using the render queue.
value | The strategy to use, nullptr to reset to the default strategy. |
void nkGraphics::RenderQueue::setHidden | ( | bool | value | ) |
Sets whether the render queue should be hidden from the project exporting functions.
value | If it should be hidden (true) or not (false). |
|
virtual |
Adds an entity into the queue.
|
virtual |
Erases and frees the memory of an entity.
ent | The entity to forget. |
|
virtual |
Clears the queue and makes it empty again.
RenderCommandQueue nkGraphics::RenderQueue::bakeRenderCommandQueue | ( | Shader * | shader = nullptr , |
bool | transparent = false |
||
) |
Translates the render queue into a command queue to render. Called by the MonoMaterialPass and RenderScenePass to eventually tansmit it to the renderer. This can also be called to check on custom strategies during their development time.
shader | A Shader to communicate as a parameter to the strategy, used by the MonoMaterialPass to provide its own shader. |
transparent | Whether the calling pass is flagged as transparent, or not. |
Updates called from registered objects. In theory, external code should not use it.
ent | The caller. |
oldNode | The node the entity updates from. |
|
virtual |
Update called from registered object. In theory, external code should not use it.
ent | The caller. |
oldInfo | The information the call updates from. |
newInfo | The new information the call updates to. |
|
virtual |
Update called from registered object. In theory, external code should not use it.
ent | The caller. |
slot | The parent slot call is made from. |
lod | The LOD the call is made from. |
oldMesh | The mesh the call updates from. |
newMesh | The mesh the call updates to. |
|
virtual |
Update called from registered object. In theory, external code should not use it.
ent | The caller. |
slot | The parent slot call is made from. |
lod | The LOD the call is made from. |
oldShader | The shader the call udpates from. |
newShader | The shader the call updates to. |
|
virtual |
Update called from registered object. In theory, external code should not use it.
ent | The caller. |
slot | The parent slot call is made from. |
lod | The LOD the call is made from. |
oldShader | The shader the call udpates from. |
newShader | The shader the call updates to. |
|
overridevirtual |
Basic exporting capabilities.
rootNode | The tree to export to. |
Implements nkExport::Exportable.
|
overridevirtual |
Basic importing capabilities.
rootNode | The tree to import from. |
Implements nkExport::Exportable.